package ankang.day140104;

import java.util.Scanner;

public class Test13 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("請輸入请输入一个int数值：");
        int num1=scanner.nextInt();

        System.out.println("請輸入请输入一个int数值：");
        int num2=scanner.nextInt();

        int n= num1>num2? num1 : num2;
        for(int i=n;      ; i++){
            if(i%num1==0 && i%num2==0){
                System.out.println("最小公倍數是："+i);
                break;
            }
        }

        int i=n;
        while(true){
            if(i%num1==0 && i%num2==0){
                System.out.println("最小公倍數是："+i);
                break;
            }
            i++;
        }



    }
}
